FROM php:8.3-fpm-alpine

ARG WORKDIR
# Copy File Config
ADD www.conf /usr/local/etc/php-fpm.d/www.conf

# ADD and set Group
RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel

# Create folder to run
RUN mkdir -p ${WORKDIR}

# Set Profile 
RUN chown laravel:laravel ${WORKDIR}

# Work in the specific space
WORKDIR ${WORKDIR}

# Add git
#RUN apk add openssh

# Add docker-php-extension-installer script
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

# Install php extensions
RUN chmod +x /usr/local/bin/install-php-extensions && \
    install-php-extensions \
	bcmath \
	bz2 \
	calendar \
	dba \
	enchant \
	exif \
	gd \
	gettext \
	gmp \
	intl \
	ldap \
	mysqli \
	odbc \
	pcntl \
	pdo_mysql \
	PDO_ODBC \
	pdo_pgsql \
	pgsql \
	pspell \
	redis \
	shmop \
	soap \
	sockets \
	sodium \
	sysvmsg \
	sysvsem \
	sysvshm \
	pcov \
	xsl \
	zip
